<?php

	/*
		Filename: admincps.php
		Description: The actual admin control panel.
		
		Last Edit: 13-08-2012 (dd-mm-yyyy)
	*/
	
	// Inlcude database
	require_once("./Config/Config.php");
	
	// Include functions
	require_once("./Config/Functions.php");
	
	// Check if user is logged in as admin
	if(isAdmin() == false) die("This page is only accessible for administrators.");
?>	
	
	<h1>Control Panel</h1>
	<hr style="margin-top: -15px;">
		<a style="margin-left: 10px;" href="./index.php?p=admincps">Main</a>
	<hr style=""><br>
	From here you can control the groups and students you created. 
	
	<form action="./index.php" method="GET">
		<input type="hidden" value="cp_group" name="p">
		
		<select name="group_name">
			<?php
				$Groups = getGroups();
				foreach($Groups as $Group)
				{
					echo '<option value="' . $Group->Id . '">' . $Group->Name . '</option>';
				}
			?>
		</select>
		<input type="submit" value="Go">
	</form>